﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime;
using System.Runtime.Remoting;
using System.Runtime.Serialization;
using System.Runtime.InteropServices;
using System.Diagnostics;
using System.IO;
using System.ComponentModel;
using System.Threading;

using PickGold.Handler;
using PickGold.Security;

namespace PickGold.Callers
{
	/// <summary/>
	public sealed class FuncToAction<TResult> : C2AF<TResult>, I2AF<TResult>, IFuncToAction<TResult>
	{
		/// <summary/>
		public Func<TResult> F;

		/// <summary/>
		protected internal override Delegate H
		{
			get
			{
				return this.F;
			}
		}

		Delegate IFuncToAction<TResult>.F
		{
			get
			{
				return this.F;
			}
		}

		/// <summary/>
		public FuncToAction(Func<TResult> f)
		{
			this.F = f;
		}

		/// <summary/>
		public FuncToAction(HByReturnDelegate<TResult> f)
		{
			this.F = new Func<TResult>(f);
		}

		/// <summary/>
		public void A()
		{
			this.R = this.F();
		}
	}

	/// <summary/>
	public sealed class FuncToAction<T, TResult> : C2AF<TResult>, I2AF<TResult>, IFuncToAction<TResult>
	{
		/// <summary/>
		public Func<T, TResult> F;

		/// <summary/>
		protected internal override Delegate H
		{
			get
			{
				return this.F;
			}
		}

		Delegate IFuncToAction<TResult>.F
		{
			get
			{
				return this.F;
			}
		}

		/// <summary/>
		public FuncToAction(Func<T, TResult> f)
		{
			this.F = f;
		}

		/// <summary/>
		public FuncToAction(HByReturnDelegate<TResult, T> f)
		{
			this.F = new Func<T, TResult>(f);
		}

		/// <summary/>
		public void A(T arg)
		{
			this.R = this.F(arg);
		}
	}

	/// <summary/>
	public sealed class FuncToAction<T1, T2, TResult> : C2AF<TResult>, I2AF<TResult>, IFuncToAction<TResult>
	{
		/// <summary/>
		public Func<T1, T2, TResult> F;

		/// <summary/>
		protected internal override Delegate H
		{
			get
			{
				return this.F;
			}
		}

		Delegate IFuncToAction<TResult>.F
		{
			get
			{
				return this.F;
			}
		}

		/// <summary/>
		public FuncToAction(Func<T1, T2, TResult> f)
		{
			this.F = f;
		}

		/// <summary/>
		public FuncToAction(HByReturnDelegate<TResult, T1, T2> f)
		{
			this.F = new Func<T1, T2, TResult>(f);
		}

		/// <summary/>
		public void A(T1 arg1, T2 arg2)
		{
			this.R = this.F(arg1, arg2);
		}
	}

	/// <summary/>
	public sealed class FuncToAction<T1, T2, T3, TResult> : C2AF<TResult>, I2AF<TResult>, IFuncToAction<TResult>
	{
		/// <summary/>
		public Func<T1, T2, T3, TResult> F;

		/// <summary/>
		protected internal override Delegate H
		{
			get
			{
				return this.F;
			}
		}

		Delegate IFuncToAction<TResult>.F
		{
			get
			{
				return this.F;
			}
		}

		/// <summary/>
		public FuncToAction(Func<T1, T2, T3, TResult> f)
		{
			this.F = f;
		}

		/// <summary/>
		public FuncToAction(HByReturnDelegate<TResult, T1, T2, T3> f)
		{
			this.F = new Func<T1, T2, T3, TResult>(f);
		}

		/// <summary/>
		public void A(T1 arg1, T2 arg2, T3 arg3)
		{
			this.R = this.F(arg1, arg2, arg3);
		}
	}

	/// <summary/>
	public sealed class FuncToAction<T1, T2, T3, T4, TResult> : C2AF<TResult>, I2AF<TResult>, IFuncToAction<TResult>
	{
		/// <summary/>
		public Func<T1, T2, T3, T4, TResult> F;

		/// <summary/>
		protected internal override Delegate H
		{
			get
			{
				return this.F;
			}
		}

		Delegate IFuncToAction<TResult>.F
		{
			get
			{
				return this.F;
			}
		}

		/// <summary/>
		public FuncToAction(Func<T1, T2, T3, T4, TResult> f)
		{
			this.F = f;
		}

		/// <summary/>
		public FuncToAction(HByReturnDelegate<TResult, T1, T2, T3, T4> f)
		{
			this.F = new Func<T1, T2, T3, T4, TResult>(f);
		}

		/// <summary/>
		public void A(T1 arg1, T2 arg2, T3 arg3, T4 arg4)
		{
			this.R = this.F(arg1, arg2, arg3, arg4);
		}
	}

	/// <summary/>
	public sealed class FuncToAction<T1, T2, T3, T4, T5, TResult> : C2AF<TResult>, I2AF<TResult>, IFuncToAction<TResult>
	{
		/// <summary/>
		public Func<T1, T2, T3, T4, T5, TResult> F;

		/// <summary/>
		protected internal override Delegate H
		{
			get
			{
				return this.F;
			}
		}

		Delegate IFuncToAction<TResult>.F
		{
			get
			{
				return this.F;
			}
		}

		/// <summary/>
		public FuncToAction(Func<T1, T2, T3, T4, T5, TResult> f)
		{
			this.F = f;
		}

		/// <summary/>
		public FuncToAction(HByReturnDelegate<TResult, T1, T2, T3, T4, T5> f)
		{
			this.F = new Func<T1, T2, T3, T4, T5, TResult>(f);
		}

		/// <summary/>
		public void A(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5)
		{
			this.R = this.F(arg1, arg2, arg3, arg4, arg5);
		}
	}

	/// <summary/>
	public sealed class FuncToAction<T1, T2, T3, T4, T5, T6, TResult> : C2AF<TResult>, I2AF<TResult>, IFuncToAction<TResult>
	{
		/// <summary/>
		public Func<T1, T2, T3, T4, T5, T6, TResult> F;

		/// <summary/>
		protected internal override Delegate H
		{
			get
			{
				return this.F;
			}
		}

		Delegate IFuncToAction<TResult>.F
		{
			get
			{
				return this.F;
			}
		}

		/// <summary/>
		public FuncToAction(Func<T1, T2, T3, T4, T5, T6, TResult> f)
		{
			this.F = f;
		}

		/// <summary/>
		public FuncToAction(HByReturnDelegate<TResult, T1, T2, T3, T4, T5, T6> f)
		{
			this.F = new Func<T1, T2, T3, T4, T5, T6, TResult>(f);
		}

		/// <summary/>
		public void A(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6)
		{
			this.R = this.F(arg1, arg2, arg3, arg4, arg5, arg6);
		}
	}

	/// <summary/>
	public sealed class FuncToAction<T1, T2, T3, T4, T5, T6, T7, TResult> : C2AF<TResult>, I2AF<TResult>, IFuncToAction<TResult>
	{
		/// <summary/>
		public Func<T1, T2, T3, T4, T5, T6, T7, TResult> F;

		/// <summary/>
		protected internal override Delegate H
		{
			get
			{
				return this.F;
			}
		}

		Delegate IFuncToAction<TResult>.F
		{
			get
			{
				return this.F;
			}
		}

		/// <summary/>
		public FuncToAction(Func<T1, T2, T3, T4, T5, T6, T7, TResult> f)
		{
			this.F = f;
		}

		/// <summary/>
		public FuncToAction(HByReturnDelegate<TResult, T1, T2, T3, T4, T5, T6, T7> f)
		{
			this.F = new Func<T1, T2, T3, T4, T5, T6, T7, TResult>(f);
		}

		/// <summary/>
		public void A(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7)
		{
			this.R = this.F(arg1, arg2, arg3, arg4, arg5, arg6, arg7);
		}
	}

	/// <summary/>
	public sealed class FuncToAction<T1, T2, T3, T4, T5, T6, T7, T8, TResult> : C2AF<TResult>, I2AF<TResult>, IFuncToAction<TResult>
	{
		/// <summary/>
		public Func<T1, T2, T3, T4, T5, T6, T7, T8, TResult> F;

		/// <summary/>
		protected internal override Delegate H
		{
			get
			{
				return this.F;
			}
		}

		Delegate IFuncToAction<TResult>.F
		{
			get
			{
				return this.F;
			}
		}

		/// <summary/>
		public FuncToAction(Func<T1, T2, T3, T4, T5, T6, T7, T8, TResult> f)
		{
			this.F = f;
		}

		/// <summary/>
		public FuncToAction(HByReturnDelegate<TResult, T1, T2, T3, T4, T5, T6, T7, T8> f)
		{
			this.F = new Func<T1, T2, T3, T4, T5, T6, T7, T8, TResult>(f);
		}

		/// <summary/>
		public void A(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8)
		{
			this.R = this.F(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
		}
	}

	/// <summary/>
	public sealed class FuncToAction<T1, T2, T3, T4, T5, T6, T7, T8, T9, TResult> : C2AF<TResult>, I2AF<TResult>, IFuncToAction<TResult>
	{
		/// <summary/>
		public Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, TResult> F;

		/// <summary/>
		protected internal override Delegate H
		{
			get
			{
				return this.F;
			}
		}

		Delegate IFuncToAction<TResult>.F
		{
			get
			{
				return this.F;
			}
		}

		/// <summary/>
		public FuncToAction(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, TResult> f)
		{
			this.F = f;
		}

		/// <summary/>
		public FuncToAction(HByReturnDelegate<TResult, T1, T2, T3, T4, T5, T6, T7, T8, T9> f)
		{
			this.F = new Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, TResult>(f);
		}

		/// <summary/>
		public void A(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9)
		{
			this.R = this.F(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
		}
	}

	/// <summary/>
	public sealed class FuncToAction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TResult> : C2AF<TResult>, I2AF<TResult>, IFuncToAction<TResult>
	{
		/// <summary/>
		public Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TResult> F;

		/// <summary/>
		protected internal override Delegate H
		{
			get
			{
				return this.F;
			}
		}

		Delegate IFuncToAction<TResult>.F
		{
			get
			{
				return this.F;
			}
		}

		/// <summary/>
		public FuncToAction(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TResult> f)
		{
			this.F = f;
		}

		/// <summary/>
		public FuncToAction(HByReturnDelegate<TResult, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> f)
		{
			this.F = new Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TResult>(f);
		}

		/// <summary/>
		public void A(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10)
		{
			this.R = this.F(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10);
		}
	}

	/// <summary/>
	public sealed class FuncToAction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, TResult> : C2AF<TResult>, I2AF<TResult>, IFuncToAction<TResult>
	{
		/// <summary/>
		public Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, TResult> F;

		/// <summary/>
		protected internal override Delegate H
		{
			get
			{
				return this.F;
			}
		}

		Delegate IFuncToAction<TResult>.F
		{
			get
			{
				return this.F;
			}
		}

		/// <summary/>
		public FuncToAction(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, TResult> f)
		{
			this.F = f;
		}

		/// <summary/>
		public FuncToAction(HByReturnDelegate<TResult, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> f)
		{
			this.F = new Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, TResult>(f);
		}

		/// <summary/>
		public void A(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11)
		{
			this.R = this.F(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11);
		}
	}

	/// <summary/>
	public sealed class FuncToAction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, TResult> : C2AF<TResult>, I2AF<TResult>, IFuncToAction<TResult>
	{
		/// <summary/>
		public Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, TResult> F;

		/// <summary/>
		protected internal override Delegate H
		{
			get
			{
				return this.F;
			}
		}

		Delegate IFuncToAction<TResult>.F
		{
			get
			{
				return this.F;
			}
		}

		/// <summary/>
		public FuncToAction(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, TResult> f)
		{
			this.F = f;
		}

		/// <summary/>
		public FuncToAction(HByReturnDelegate<TResult, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> f)
		{
			this.F = new Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, TResult>(f);
		}

		/// <summary/>
		public void A(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12)
		{
			this.R = this.F(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12);
		}
	}

	/// <summary/>
	public sealed class FuncToAction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, TResult> : C2AF<TResult>, I2AF<TResult>, IFuncToAction<TResult>
	{
		/// <summary/>
		public Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, TResult> F;

		/// <summary/>
		protected internal override Delegate H
		{
			get
			{
				return this.F;
			}
		}

		Delegate IFuncToAction<TResult>.F
		{
			get
			{
				return this.F;
			}
		}

		/// <summary/>
		public FuncToAction(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, TResult> f)
		{
			this.F = f;
		}

		/// <summary/>
		public FuncToAction(HByReturnDelegate<TResult, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> f)
		{
			this.F = new Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, TResult>(f);
		}

		/// <summary/>
		public void A(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13)
		{
			this.R = this.F(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13);
		}
	}

	/// <summary/>
	public sealed class FuncToAction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, TResult> : C2AF<TResult>, I2AF<TResult>, IFuncToAction<TResult>
	{
		/// <summary/>
		public Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, TResult> F;

		/// <summary/>
		protected internal override Delegate H
		{
			get
			{
				return this.F;
			}
		}

		Delegate IFuncToAction<TResult>.F
		{
			get
			{
				return this.F;
			}
		}

		/// <summary/>
		public FuncToAction(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, TResult> f)
		{
			this.F = f;
		}

		/// <summary/>
		public FuncToAction(HByReturnDelegate<TResult, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> f)
		{
			this.F = new Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, TResult>(f);
		}

		/// <summary/>
		public void A(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13, T14 arg14)
		{
			this.R = this.F(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14);
		}
	}

	/// <summary/>
	public sealed class FuncToAction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, TResult> : C2AF<TResult>, I2AF<TResult>, IFuncToAction<TResult>
	{
		/// <summary/>
		public Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, TResult> F;

		/// <summary/>
		protected internal override Delegate H
		{
			get
			{
				return this.F;
			}
		}

		Delegate IFuncToAction<TResult>.F
		{
			get
			{
				return this.F;
			}
		}

		/// <summary/>
		public FuncToAction(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, TResult> f)
		{
			this.F = f;
		}

		/// <summary/>
		public FuncToAction(HByReturnDelegate<TResult, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> f)
		{
			this.F = new Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, TResult>(f);
		}

		/// <summary/>
		public void A(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13, T14 arg14, T15 arg15)
		{
			this.R = this.F(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15);
		}
	}

	/// <summary/>
	public sealed class FuncToAction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, TResult> : C2AF<TResult>, I2AF<TResult>, IFuncToAction<TResult>
	{
		/// <summary/>
		public Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, TResult> F;

		/// <summary/>
		protected internal override Delegate H
		{
			get
			{
				return this.F;
			}
		}

		Delegate IFuncToAction<TResult>.F
		{
			get
			{
				return this.F;
			}
		}

		/// <summary/>
		public FuncToAction(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, TResult> f)
		{
			this.F = f;
		}

		/// <summary/>
		public FuncToAction(HByReturnDelegate<TResult, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> f)
		{
			this.F = new Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, TResult>(f);
		}

		/// <summary/>
		public void A(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13, T14 arg14, T15 arg15, T16 arg16)
		{
			this.R = this.F(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16);
		}
	}

	/// <summary/>
	public interface IFuncToAction<TResult> : I2AF<TResult>
	{
		/// <summary/>
		Delegate F { get; }
	}

	/// <summary/>
	public abstract class C2AF<TResult> : I2AF<TResult>
	{
		/// <summary/>
		public object D;
		/// <summary/>
		public TResult R;

		/// <summary>
		/// 
		/// </summary>
		protected internal abstract Delegate H { get; }

		object I2AF<TResult>.D
		{
			get
			{
				return this.D;
			}
			set
			{
				this.D = value;
			}
		}

		TResult I2AF<TResult>.R
		{
			get
			{
				return this.R;
			}
			set
			{
				this.R = value;
			}
		}

		Delegate I2AF<TResult>.H
		{
			get
			{
				return this.H;
			}
		}

		/// <summary/>
		public override int GetHashCode()
		{
			if (this.H == null || this.H.Target == null)
				return base.GetHashCode();

			return this.H.Target.GetHashCode();
		}

		/// <summary/>
		public override bool Equals(object obj)
		{
			if (this.H == null || this.H.Target == null)
				return base.Equals(obj);

			return this.H.Target.Equals(obj);
		}

		/// <summary/>
		public override string ToString()
		{
			if (this.H == null || this.H.Target == null)
				return base.ToString();

			return this.H.Target.ToString();
		}
	}
}
